<template>
  <div>
    <h4>GrandChild</h4>
    <p v-if="called">Parent called <em>myMethod</em> of GrandChild</p>
  </div>
</template>
<script setup>
import { ref } from 'vue';

const called = ref(false);

function myMethod() {
  called.value = true;
  console.log('myMethod called in GrandChild component');
}

defineExpose({
  myMethod
})
</script>
<style lang="">

</style>